package com.demo2;

import java.time.ZonedDateTime;
import java.util.concurrent.TimeUnit;

public class demo2 {
    public static void main(String[] args) {
        String str[] = {"ftlower","flow","flogwht"};
        /* System.out.println(tt(str));*/

        ZonedDateTime zonedDateTime=ZonedDateTime.now();
        System.out.println(zonedDateTime);
        try {
            TimeUnit.SECONDS.sleep(1000);
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

   public static String tt(String[] strs) {
       
        if (strs.length == 1) {
            return strs[0];
        }
        String s = strs[0];
        for (int i = 1; i < strs.length; i++) {
            int k = -1;
            String ss = strs[i];
            int n = s.length() > ss.length() ? ss.length() : s.length();
            for (int j = 0; j < n; j++) {

                if (s.charAt(j) != ss.charAt(j)) {
                    break;
                }else{
                    k=j;
                }
            }
            if(k==-1){
                return "";
            }
            s=s.substring(0,k+1);
        }
        return s;
    }
}